package reflect;

import java.lang.reflect.Constructor;

public class Test {
    public static void main(String[] args) throws Exception{
        Class cls=Class.forName("reflect.Student");
        Constructor c1=cls.getConstructor();
        Object obj=c1.newInstance();
        System.out.println(obj);
        Constructor c2=cls.getConstructor(String.class,int.class,char.class);
        Object obj1=c2.newInstance("张三",18,'男');
        System.out.println(obj1);
    }
}
